
<%@include file="Conectar.jsp" %>
<%@page import="java.sql.ResultSet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pet Social</title>
         <link rel="stylesheet" type="text/css" href="css/geral.css">
          <link rel="stylesheet" type="text/css" href="css/index.css">
          
          <style>
            
#busca{
    width:400px;
    height:40px;
    border: 1px solid blueviolet;
}
#Encontrar{
   height:44px;
   border:1px solid blueviolet;
   background-color:blue;
   font-size: 1.4em;
    background: #F90;
    border: 0;
    margin-bottom: 6em;
    color: #FFF;
    padding: 0.1em 0.3em;
    box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
   
   font-family:monospace;
}
          #tabela2{ 
			position:relative;
			float:left;
			left:0px;
			width:100%;
			top:50px;
			text-align:center;
			
			}
                        
                         .alinhamento{
                            text-align:justify;
                             background-color:whitesmoke;
                        }
                        #meusanimais{
                          font-family:monospace;
                           font-size:20px;
                           color:darkgreen;
                           text-align:justify;  
                        }
                        .tdcor{
                            background-color:whitesmoke;
                        }
                        #historico{
                           font-family:monospace;
                           font-size:14px;
                           color:blue;
                           text-align:center;
                           border:1px solid aqua;
                        }
                         #txt{
                  border:0px;
                  color:white;
                  width:1px;
              }
              .labelusuario{
                            font-family:sans-serif;
                            font-weight: bold;
                            font-size:12px;
                            color:darkseagreen;
                        }
                        #tabelaFiltro{
                            position:absolute;
                            float:left;
                            left:0;
                            top:30px;
                            width:100%;
                            text-align:center;
                        }
                        
                        .direita{
                            text-align:right;
                             color: #000;
                              display: inline-block;
                              margin-right: 1em;
                        }
                        .esquerda{
                            text-align:left;
                            color: #000;
                            display: inline-block;
                            margin-right: 1em;
                        }
                        #s{
                            position:relative;
                            float:left;
                            left:60px;
                            
                        }
          </style>
    </head>
     <body >
   
        
	  <div id="barraMenu">
              <div id="slogan"><img id="desenho" src="img/slogan.jpg"/></div>
              <div id="identidade">
                  <table  id="tabela" border="0"  >
                               
                              
                      <form action="login.jsp" method="post">
                          
                          
                               <tr><td class="tds" colspan="3" >
                                       
                                       <label class="fonteLogin">Login:</label><input type="email" id="emailInput"  class="text" name="TXTEMAIL" /></td>
                                   <td><label class="fonteLogin">Senha:</label><input type="password" id="inputSenha"  class="text" name="TXTSENHA" /></td>
                                   <td> <input type="submit" id="inputBtn" value="Entrar"></td> </tr>
                      </form>
			   
			   
                           </table>
              </div>
              
          </div> 
	    <!-- div que limita o tamanho do corpo do documento em 1024 X 768-->
	   <div id="corpo">
	    
		
	      <form action="" method="post" id="form">
                  <table border="0" id="tabelaFiltro">
                                           
                                           <tr><td class="direita"><label >Gato</label><input type="radio" name="TXTTIPO" value="Gato"></td><td class="esquerda"><label >Cachorro</label><input type="radio" name="TXTTIPO" value="Cachorro"></td></tr>
                                           <tr><td class="direita"><label >Femea</label><input type="radio" name="TXTSEXO" value="Feminino"></td><td class="esquerda"> <label >Macho</label><input type="radio" name="TXTSEXO" value="Masculino" id="s"> </td></tr>
                                           <tr><td colspan="2">  <input type="text" name="TXTBUSCA" id="busca"><input type="submit" value="Buscar" id="Encontrar"></td></tr>
                                       </table>
              
               
            
              
              
              
               </form><br><br>	 
			 
               <%
                   String busca=request.getParameter("TXTBUSCA");
                   String tipo=request.getParameter("TXTTIPO");
                   String sexo=request.getParameter("TXTSEXO");
                   if(!"".equals(request.getParameter("TXTBUSCA"))&&busca!=null ){
                                    try{
                   String qry="SELECT * FROM petsocial.animal WHERE (TIPO='"+tipo+"' AND SEXO='"+sexo+"') AND HISTORICO like '%"+busca+"%'  ";
                    
                   
                   ResultSet rs=sql.executeQuery(qry);
                    boolean result=true;
                    
                   while(rs.next()){
                         out.print("<table border=0 id='tabela2'>"+
                           
                            "<tr><td  colspan='1' class='alinhamento'><input type='text' value="+rs.getString("ID_ANIMAL")+" name='TXTID' id='txt'>"+ "</td>"+"<td  colspan='3' id='historico'>"+ rs.getString("HISTORICO") + "</td></tr>"+
                             "<tr><td class='alinhamento' > <label class='labelusuario'>Sexo: </label>"+ rs.getString("SEXO")+ "</td>"+"<td class='tdcor'><label class='labelusuario'>Raça: </label>"+ rs.getString("RACA") + "</td class='tdcor'>"+"<td class='tdcor'><label class='labelusuario'>Idade: </label>"+ rs.getString("IDADE") + "</td>"+"<td class='tdcor'><label class='labelusuario'>Cor: </label>"+ rs.getString("COR") + "</td></tr>"+
                            "<tr><td  colspan='4' class='alinhamento'><label class='labelusuario'>Descrição das Vacinas: </label>"+ rs.getString("DESC_VACINAS") + "</td></tr>"+
                             "<tr><td  colspan='4'class='alinhamento'><label class='labelusuario'>Descrição das Doenças: </label>"+ rs.getString("DESC_DOENCAS") + "</td></tr>"+
                            "<tr><td  colspan='4'class='alinhamento'><label class='labelusuario'>Descrição das Deficiências: </label>"+ rs.getString("DESC_DEFICIENCIAS") + "</td></tr>"+
                            
                             "</table><br>" );
		   
                       
                      
                   }
               }catch(Exception e){
                   
               }
                     }
	       %>
		     
			 
			 
	   		 
	   </div>
	   
   </body>
</html>
